package in.muton.edushare.components.error;

import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.IModel;

import com.edushare.common.util.StringUtil;

public class ErrorPanel extends Panel {

	public ErrorPanel(String id, IModel<String> model) {
		super(id, model);
		errorString = model;
		add(new Label("errorMessage",model));
	}
	
	@Override
	public boolean isVisible(){
		if(super.isVisible() == false)
			return false;
		if(StringUtil.isValid(errorString.getObject()))
			return true;
		return false;
	}
	public IModel<String> errorString;
	
	private static final long serialVersionUID = -6633989603134011750L;
}
